#Warning: must be root!

Version=0.9.8c
InstallDir:=$(shell pwd)/tmp/usr

.PHONY: all clean dist_clean

all:openssl.tgz

openssl.tgz: openssl-$(Version).tar.gz 
	tar -xzf openssl-$(Version).tar.gz
	mkdir -p $(InstallDir)
	cd openssl-$(Version);./config no-asm --prefix=$(InstallDir) shared
	$(MAKE) -C openssl-$(Version)
	$(MAKE) -C openssl-$(Version) install
	mkdir -p usr/lib
	cp -af $(InstallDir)/lib/libcrypto.so usr/lib
	cp -af $(InstallDir)/lib/libcrypto.so.0.9.8 usr/lib/libcrypto.so.0.9.8
	cp -af $(InstallDir)/lib/libssl.so usr/lib
	cp -af $(InstallDir)/lib/libssl.so.0.9.8 usr/lib
	tar -czf openssl.tgz usr

clean:
	rm -rf *.tgz usr tmp

dist_clean:clean
	rm -rf *.tar.gz openssl-$(Version)
	

include ../Makefile.Res
